package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class PwDemo {
    public static void main(String[] args) throws FileNotFoundException {
        /*
        PrintWriter pw = new PrintWriter("pw.txt");
        pw.println("夜空中最亮的星");
        pw.println("是否听清");
        System.out.println("写出完毕");
        pw.close();

         */
        FileOutputStream fos = new FileOutputStream("pp.txt");
        OutputStreamWriter wos = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bos = new BufferedWriter(wos);
        PrintWriter pw = new PrintWriter(bos);
        pw.println("夜空中最亮的星");
        pw.println("是否听清");
        System.out.println("写出完毕");
        pw.close();


    }
}
